import request from '@/config/axios'

export interface Model {
  id: string | undefined
  title: string
  type: number
  content: string
  remark: string
  creator: string
  createTime: Date
}

// 查询公告列表
export const getPage = (params: PageParam) => {
  return request.get({ url: import.meta.env.VITE_BASE_ROLE + '/userCenter/form/formSubmit/page.json', params })
}

// 查询公告详情
export const getById = (id: string) => {
  return request.get({ url: import.meta.env.VITE_BASE_ROLE + '/userCenter/form/formSubmit/getById.json?id=' + id })
}

// 修改公告
export const update = (data: Model) => {
  console.log('up')

  return request.put({ url: import.meta.env.VITE_BASE_ROLE + '/userCenter/form/formSubmit/update.json', data })
}

// 删除公告
export const del = (id: string) => {
  return request.delete({ url: import.meta.env.VITE_BASE_ROLE + '/userCenter/form/formSubmit/del.json?id=' + id })
}
